{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd,xlwings as xw,订单完成_函数 as dd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "wb=xw.Book(r'C:\\Users\\UUPT\\Desktop\\应付工作\\7月\\代理商跑男提现\\7月代理商跑男提现支付表(2).xlsx')\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "df1=wb.sheets('31').range('B2:l322').options(pd.DataFrame).value.reset_index()\n",
    "df1=df1.iloc[0:] #因为是合并单元格表头，所以从第二行开始取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "代理跑男提现支付=dd.通用凭证模版(dd.clm,'应付凭证',摘要='7.31支付'+df1['往来单位']+'跑男提现',科目编码='22413002',借贷方向='借方',本币=df1['中信支付'],\n",
    "               往来单位编码=df1['往来单位编码'],往来单位=df1['往来单位']) \n",
    "\n",
    "中信支付=dd.通用凭证模版(dd.clm,'应付凭证',摘要='7.31支付代理跑男提现',科目编码='100215',借贷方向='贷方',本币=[df1['中信支付'].sum()])\n",
    "\n",
    "\n",
    "\n",
    "代理跑男提现退回=dd.通用凭证模版(dd.clm,'应付凭证',摘要='7.31支付'+df1['往来单位']+'跑男提现退回',科目编码='22413002',借贷方向='借方',本币=df1['中信退回'],\n",
    "               往来单位编码=df1['往来单位编码'],往来单位=df1['往来单位']) \n",
    "\n",
    "中信支付退回=dd.通用凭证模版(dd.clm,'应付凭证',摘要='7.31支付代理跑男提现 退回',科目编码='100215',借贷方向='贷方',本币=[df1['中信退回'].sum()])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "凭证=pd.concat([代理跑男提现支付,中信支付,代理跑男提现退回,中信支付退回]) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "凭证.to_clipboard()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
